import org.w3c.dom.*;

import javax.xml.soap.Node;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import java.util.LinkedList;

class ListNode{
    public int val;
    public ListNode next;
    public ListNode(int val){
        this.val=val;
    }
}
class MyList{
    private ListNode head=null;
    public boolean add(int a){
        ListNode NewNode=new ListNode(a);
        if(head==null){
            head=NewNode;
            return true;
        }
        ListNode cur=head;
        while (cur.next!=null){
            cur=cur.next;
        }
        cur.next=NewNode;
        return true;
    }
    public boolean delete(int a){//删除指定节点
        if(head==null){
            return false;
        }
        if(head.val==a){
            head=head.next;
        }
        ListNode cur=head;
        while (cur.next!=null){
            if(cur.next.val==a){
                cur.next=cur.next.next;
            }
            cur=cur.next;
            return true;
        }
        return false;
    }
}
public class Main {
    public static void main(String[] args) {
        LinkedList<Integer> sites=new LinkedList<Integer>();
        sites.addLast(1);
        sites.addLast(2);
        System.out.println(sites);
    }
}